@extends('layouts.admin')
@section('css')
<link rel="stylesheet" type="text/css" href="{{ asset('admin/assets/bootstrap-fileupload/bootstrap-fileupload.css') }}" />
@endsection
@section('content')
<section id="main-content">
          <section class="wrapper">
              <!-- page start-->
             
              <div class="row">
               
                  <div class="col-lg-12">
                      <section class="panel">
                          <header class="panel-heading">
                              编辑【{{ $option->name }}】
                          </header>
                          <div class="panel-body">
                                @if (count($errors) > 0)
                                <div class="alert alert-block alert-danger fade in">
                                  <button data-dismiss="alert" class="close close-sm" type="button">
                                      <i class="icon-remove"></i>
                                  </button>
                                  <!-- <strong>Oh snap!</strong> Change a few things up and try submitting again. -->
                                   <ul>
                                        @foreach ($errors->all() as $error)
                                        <li>{{ $error }}</li> 
                                        @endforeach
                                    </ul>
                              </div>
                              @endif
                              <form class="form-horizontal" action="{{ route('admin.shop.option.edit',['id'=>$option->id])}}" role="form" method="POST" enctype="multipart/form-data">
                                  
                                                                    <div class="form-group last">
                                          <label class="control-label col-lg-2 col-sm-2 ">图标</label>
                                          <div class="col-lg-10">
                                              <div class="fileupload fileupload-new" data-provides="fileupload">
                                                  <div class="fileupload-new thumbnail" style="width: 200px; height: 150px;">
                                                      @if(empty($option->icon))
                                                      <img src="http://www.placehold.it/200x150/EFEFEF/AAAAAA&amp;text=no+image" alt="" />
                                                      @else
                                                      <img src="{{ asset($option->icon) }}" alt="" />
                                                      @endif
                                                  </div>
                                                  <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 200px; max-height: 150px; line-height: 20px;"></div>
                                                  <div>
                                                   <span class="btn btn-white btn-file">
                                                   <span class="fileupload-new"><i class="icon-paper-clip"></i> 选择图片</span>
                                                   <span class="fileupload-exists"><i class="icon-undo"></i> 更改</span>
                                                   <input type="file" class="default" name="picurl" />
                                                   </span>
                                                      <a href="#" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"><i class="icon-trash"></i> 删除</a>
                                                  </div>
                                              </div>
                                              <span class="label label-danger">注意!</span>
                                             <span>
                                             只支持火狐、谷歌、Safari及IE10等新版浏览器
                                             </span>
                                          </div>
                                      </div>

              
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">名称</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="Name" name="name" value="{{ $option->name }}" placeholder="Name">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">代码</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="Code" name="code" value="{{ $option->code }}" placeholder="Code">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  
                                               <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">交易货币</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="currency_name" value="{{ $option->currency_name }}" name="currency_name" placeholder="交易使用货币名称">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">货币单位</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="currency_unit" value="{{ $option->currency_unit }}" name="currency_unit" placeholder="货币流通单位符号">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">对人民币汇率</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="exchange_rate" value="{{ $option->exchange_rate }}" name="exchange_rate" placeholder="汇率保留2位小数">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>

                                   <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">最小波动</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="fluctuation" value="{{ $option->fluctuation }}" name="fluctuation" placeholder="最小波动点数">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">最小波动价格</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="fluctuation_price" value="{{ $option->fluctuation_price }}" name="fluctuation_price" placeholder="最小波动价格">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">可选手数</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control tagsinput" id="hand_count" value="{{ $option->hand_count }}" name="hand_count" placeholder="可选手数">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">止盈值</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control tagsinput" id="surplus_value" value="{{ $option->surplus_value }}" name="surplus_value" placeholder="止盈值">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">止损值</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control tagsinput" id="stop_loss_value" value="{{ $option->stop_loss_value }}" name="stop_loss_value" placeholder="止损值">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">止损保证金</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control tagsinput" id="stop_loss_margin" value="{{ $option->stop_loss_margin }}" name="stop_loss_margin" placeholder="止损保证金">
                                          <p class="help-block"></p>
                                          <span class="label label-danger">提示!</span>
                                                       <span>
                                                       按照 止盈值、止损值、止损保证金必须按顺序一一对应设置，设置的值货币单位都是产品原本对应的货币单位例如：恒指的是HK$
                                                       </span>
                                      </div>
                                  </div>

                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">综合交易费</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="transaction_cost" value="{{ $option->transaction_cost }}" name="transaction_cost" placeholder="综合交易费">
                                          <p class="help-block"></p>
                                      </div>

                                  </div>



                                  <div class="form">

                                              <div class="form-group">
                                                  <label class="col-sm-2 control-label col-sm-2">时段</label>
                                                  <div class="col-sm-10">
                                                      <textarea class="form-control " name="times" rows="6">{{ $option->times }}</textarea>
                                                      <span class="label label-info">提示!</span>
                                                       <span>
                                                       按照 09:15-12:00,13:00-16:30,17:15-23:45 格式写入
                                                       </span>
                                                  </div>
                                              </div>
                                   
                                      </div>
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">时段描述</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="timesdescription" value="{{ $option->timesdescription }}" name="timesdescription" placeholder="时段描述">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  
                                    <div class="form">

                                              <div class="form-group">
                                                  <label class="col-sm-2 control-label col-sm-2">描述</label>
                                                  <div class="col-sm-10">
                                                      <textarea class="form-control " name="description" rows="6">{{ $option->description }}</textarea>
                                                      
                                                  </div>
                                              </div>
                                   
                                      </div>
                                    <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">排序</label>
                                      <div class="col-lg-10">
                                          <input type="text" class="form-control" id="sort" name="sort" value="{{ $option->sort }}" placeholder="Sort">
                                          <p class="help-block"></p>
                                      </div>
                                  </div>
                                  
                                  <div class="form-group">
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label">状态</label>
                                      <div class="col-lg-10">
                                          <select class="form-control input-lg m-bot15" name="status">
                                              <option value=0 {{ $option->status == 0 ? 'selected':'' }}>未开启</option>
                                              <option value=1 {{ $option->status == 1 ? 'selected':'' }}>进行中</option>
                                              <option value=2 {{ $option->status == 2 ? 'selected':'' }}>休市期</option>
                                          </select>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <label class="col-sm-2 control-label col-sm-2">规则说明</label>
                                      <div class="col-sm-10">
                                          <textarea class="form-control ckeditor" name="rules" rows="6">{!! $option->rules !!}</textarea>
                                      </div>
                                  </div>
                                  <div class="form-group">
                                      <div class="col-lg-offset-2 col-lg-10">
                                            {{ csrf_field() }}
                                            <input type="hidden" class="form-control" id="msgtype" name="msgtype" />
                                          <button type="submit" class="btn btn-danger">提交</button>
                                      </div>
                                  </div>
                                  
                              </form>
                          </div>
                      </section>
                      
                  </div>
              </div>

             
              <!-- page end-->
          </section>
      </section>
@endsection
@section('javascript')
 @parent
  <!-- <script type="text/javascript" src="{{ asset('backend/assets/ckeditor/ckeditor.js') }}"></script> -->
  <script type="text/javascript" src="{{ asset('admin/assets/bootstrap-fileupload/bootstrap-fileupload.js') }}"></script>
   <!-- <script src="{{ asset('backend/js/advanced-form-components.js') }}"></script> -->
  <script type="text/javascript" src="{{ asset('admin/assets/ckeditor/ckeditor.js')}}"></script>
  <script src="{{ asset('admin/js/bootstrap-switch.js')}}"></script>
  <script type="text/javascript" src="{{ asset('admin/js/jquery.tagsinput.js')}}"></script>
  <script type="text/javascript">
  $(function() {

        $(".tagsinput").tagsInput();
        $("[data-toggle='switch']").wrap('<div class="switch" />').parent().bootstrapSwitch();

    });
  </script>
<!-- <script src="{{ asset('admin/js/form-component.js') }}"></script> -->
@endsection

